package it.uniba.di.mas.jpnde.console;

import it.uniba.di.mas.jpnde.gui.ConsoleFrame;

public class ConsoleFactory {
	private static IConsoleUI console=null;
	
	public static IConsoleUI createConsole(IConsoleBackEnd consoleBe){
		console=new ConsoleFrame(consoleBe);
		((ConsoleFrame)console).setTitle("JPNDE Console - "+consoleBe.getId());
		((ConsoleFrame)console).setVisible(true);
		return console;
	}
	
	public static IConsoleUI getConsole()
		throws Exception {
		if (console==null)
			throw new Exception("Console not created !");
		return console;
	}
}
